<template>
	<div v-html="html"></div>
</template>

<script>
	export default{
		props:{
			url: {
				required: true
			}
		},
		data(){
			return {
				html: ''
			}
		},
		watch:{
			url(v){
				this.load(v)
			}
		},
		mounted () {
		   this.load(this.url)
		  },
		methods:{
			load(url){
				if (url && url.length > 0) {
				let param = {
					accept: 'text/html, text/plain'
				}
				this.$http.get(url, param).then((response) => {
					// 处理HTML显示
					this.html = response.data
				}).catch(() => {
					this.html = '加载失败'
				})
				}
			}
		}
	}
</script>

<style>
	body{
		padding: 0 !important;
	}
</style>
